local test = fk.CreateSkill {
    name = "test",
    anim_type = "drawcard",
}

Fk:loadTranslationTable {
    ["test"] = "测试",
    [":test"] = "一名角色的回合结束时，你获得一个？，至多X个。<br>准备阶段，或当你成为其他角色使用【杀】的目标时，你移去所有？，摸等量的牌(X为你的体力上限)。",

    ["@test"] = "?",
}
test:addEffect(fk.TurnEnd, {
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(test.name)
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        if player:getMark("@test") < player.maxHp then
            player.room:addPlayerMark(player, "@test")
        end
    end,
})

local spec = {
    on_cost = function(self, event, target, player, data)
        return player.room:askToSkillInvoke(player,
            { skill_name = test.name, prompt = "测试：是否移去所有？，摸" .. player:getMark("@test") .. "张牌" })
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:setPlayerMark(player, "@test", 0)
        player:drawCards(player:getMark("@test"), test.name)
    end,
}
test:addEffect(fk.TargetConfirmed, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(test.name) and data.card.trueName == "slash" and
            player:getMark("@test") > 0
    end,
    on_cost = spec.on_cost,
    on_use = spec.on_use
})
test:addEffect(fk.EventPhaseStart, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(test.name) and player.phase == Player.Start and
            player:getMark("@test") > 0
    end,
    on_cost = spec.on_cost,
    on_use = spec.on_use
})
return test
